package com.example.solrdemo.dao;

import com.example.solrdemo.pojo.A;
import org.springframework.data.domain.Pageable;
import org.springframework.data.solr.core.query.Query.Operator;
import org.springframework.data.solr.core.query.result.HighlightPage;
import org.springframework.data.solr.repository.Highlight;
import org.springframework.data.solr.repository.Query;
import org.springframework.data.solr.repository.SolrCrudRepository;

import java.util.Collection;

public interface ARep extends SolrCrudRepository<A, String> {
    //查询并高亮结果
    @Highlight(prefix = "<b>", postfix = "</b>")
    @Query(fields = {"id", "content", "b"}, defaultOperator = Operator.AND)
    HighlightPage<A> findByBIn(Collection<String> bs, Pageable page);
}

